<template>
  <div>
    <!--条件筛选-->
    <TopFilter :list="topFilterList" :cols="3" @filterChange="changeHandle" @onCollapse="collapseHandle"></TopFilter>
    <!--操作 -->
    <button-area :style="{ paddingLeft: '80px' }"></button-area>
    <!-- 列筛选-->
    <FilterTable
      ref="table"
      columnsRef="lhmPeoplyEfficiencyJournaling"
      :columns="columns"
      :fetchapi="fetchApi"
      :params="fetchParams"
      :isPagination="isPagination"
      :datakey="'records'"
      :onColumnsChange="columns => (this.columns = columns)"
      :onRowSelectChange="selectData"
    >
      <!--列操作-->
      <template slot="controls">
      </template>
    </FilterTable>
    <FilterTable
      ref="table1"
      columnsRef="lhmPeoplyEfficiencyJournaling1"
      :columns="columns1"
      :fetchapi="fetchApi1"
      :params="fetchParams"
      :datakey="'records'"
      :isPagination="isPagination1"
      :onColumnsChange="columns1 => (this.columns1 = columns1)"
      :onRowSelectChange="selectData1"
    >
      <!--列操作-->
      <template slot="controls">
      </template>
    </FilterTable>
  </div>
</template>

<script>
import { dictionary } from '@/utils/dictMixin';
import {  } from '@/api/repair/queryStatistics/peoplyEfficiencyJournaling';

export default {
  name: 'LHMPeoplyEfficiencyJournaling',
  components: {
  },
  mixins: [dictionary],
  data() {
    return {
      topFilterList: this.createTopFilterList(),
      fetchParams: {},
      isPagination1:true,
      isPagination:true,
      fetchApi: '',
      columns: this.createTableColumns(),
      columns1: this.createTableColumns1(),

    };
  },
  mounted() {
    // 分页
    this.BaseTable = this.$refs.table.$refs.pageTable;
    this.BaseTable = this.$refs.table1.$refs.pageTable;
  },
  methods: {
    createTopFilterList() {
      return [
        {
          type: 'RANGE_DATE',
          label: '日期',
          fieldName: 'beginDate|endDate',
          placeholder: '选择日期'
        }
      ];
    },
    createTableColumns() {
      return [
        {
          title: '序号',
          dataIndex: 'index',
          width: 70,
          sorter: true,
          render: props => {
            return <span>{props.row.index + 1}</span>;
          }
        },
        {
          title: '技师P码',
          dataIndex: 'JSPM',
          sorter: true,
          filter: true,
          filterType: 'input'
        },
        {
          title: '技师名称',
          dataIndex: 'TECHNICIAN_NAME',
          sorter: true,
          filter: true,
          filterType: 'input'
        },
        {
          title: '出勤工时(TU)',
          dataIndex: 'CQGSTU',
          sorter: true,
          filter: true,
          filterType: 'number'
        },
        {
          title: '售出工时(TU)',
          dataIndex: 'XCGS',
          sorter: true,
          filter: true,
          filterType: 'number'
        },
        {
          title: '生产性工时(TU)',
          dataIndex: 'SCXGS',
          sorter: true,
          filter: true,
          filterType: 'number'
        },
        {
          title: '劳动利用率',
          dataIndex: 'LDLYL',
          sorter: true,
          filter: true,
          filterType: 'number'
        },
        {
          title: '劳动效率',
          dataIndex: 'LDXL',
          sorter: true,
          filter: true,
          filterType: 'number'
        },
        {
          title: '内部工时(TU)',
          dataIndex: 'NBGS',
          sorter: true,
          filter: true,
          filterType: 'number'
        },
        {
          title: '劳动生产率',
          dataIndex: 'LDSCL',
          sorter: true,
          filter: true,
          filterType: 'number'
        },
        {
          title: '返工台次',
          dataIndex: 'FGTC',
          sorter: true,
          filter: true,
          filterType: 'number'
        },
        {
          title: '参与总台次',
          dataIndex: 'CYZTC',
          sorter: true,
          filter: true,
          filterType: 'number'
        },
        {
          title: '个人内返率',
          dataIndex: 'GRNFL',
          sorter: true,
          filter: true,
          filterType: 'number'
        },
        {
          title: '参与维修工单数',
          dataIndex: 'CYWXGDS',
          sorter: true,
          filter: true,
          filterType: 'number'
        },
        {
          title: '参与工单正确刷单数',
          dataIndex: 'CYGDZQSDS',
          sorter: true,
          filter: true,
          filterType: 'number'
        },
        {
          title: '刷单正确率',
          dataIndex: 'SDZQL',
          sorter: true,
          filter: true,
          filterType: 'number'
        },
        {
          title: '中断时长',
          dataIndex: '22',
          sorter: true,
          filter: true,
          filterType: 'number'
        }
      ];
    },
    createTableColumns1() {
      return [
        {
          title: '序号',
          dataIndex: 'index',
          width: 70,
          sorter: true,
          render: props => {
            return <span>{props.row.index + 1}</span>;
          }
        },
        {
          title: 'P码',
          dataIndex: '31',
          sorter: true,
          filter: true,
          filterType: 'input'
        },
        {
          title: '质检员名称',
          dataIndex: '32',
          sorter: true,
          filter: true,
          filterType: 'input'
        },
        {
          title: '参与总台次',
          dataIndex: '33',
          sorter: true,
          filter: true,
          filterType: 'input'
        },
        {
          title: '平均质检时长(MIN)',
          dataIndex: '4',
          sorter: true,
          filter: true,
          filterType: 'input'
        }
      ];
    },
    selectData(val) {
      this.tableData = val;
    },
     selectData1(val) {
      this.tableData1 = val;
    },

    changeHandle(val) {
      this.fetchParams = Object.assign({}, val);
    },
    collapseHandle() {
      this.$nextTick(() => {
        this.BaseTable.EXECUTE_RESET_HEIGHT();
      });
    },
  }
};
</script>

<style lang="less" scoped></style>
